#include <stdio.h>
#include <stdlib.h> 

int f1,f2,n,fn,flag;
void Fei(int a,int b,int now)
{
	if(now==n+1)
	return ;
	printf("%d",a+b);
	Fei(b,a+b,now+1);
	return ;
}







int main()
{
    printf("Please input the way of caculate (Input 1 for recursion;input 2 for iteration. Input control+z to quit\n");
	while(scanf("%d",&flag)!=EOF)
	{
		printf("Please input the first,the second number and the number of series.\n");
    	scanf("%d%d%d",&f1,&f2,&n);
    	int flag;
		printf("%d%d",f1,f2);
		if(flag==1)
		{
			Fei(f1,f2,3);
			puts("");
		}
		else
		{
			for(int i=3;i<=n;i++)
			{
				printf("%d",f1+f2);
				fn=f1;
				f1=f2;
				f2=f1+fn;
			}
		puts("");
		}
		printf("Please input the way of caculate (Input 1 for recursion;input 2 for iteration. Input control+z to quit\n");
    }
	return 0;
}
